package com.dst.controller;

import com.dst.eneity.Brand;
import com.dst.service.BrandService;
import com.dst.service.impl.BrandServiceImpl;
import com.dst.service.impl.PhoneServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;

@WebServlet(urlPatterns = "/brand/selectAllBrandController")
public class SeletctAllBrandController extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        BrandService brandService = new BrandServiceImpl();
        List<Brand> brands = brandService.selectBrand();
        req.setAttribute("brands",brands);
        req.getRequestDispatcher("/brand-list.jsp").forward(req,resp);
    }
}
